const path = require('path');
const CopyPlugin = require("copy-webpack-plugin");

module.exports = {
    entry: './src/main.js', // 明确指定入口文件
    output: {
        path: path.resolve(__dirname, 'mobile/www'),
        filename: 'bundle.js',
        publicPath: './'
    },
    plugins: [
        new CopyPlugin({
            patterns: [
                { 
                    from: "index.html",
                    to: "../mobile/www/index.html"
                },
                {
                    from: "assets/**/*",
                    to: "../mobile/www/[path]/[name][ext]"
                }
            ],
        }),
    ]
};